def diff():
	m = int(input("input1: "))
	n = int(input("input2: "))
	if m > n:
		print(m-n)
	else:
		print(n-m)
	return m,n

a,b = diff()
c,d = diff()
e,f = diff()
g,h = diff()